package com.rd.teacher.jichao.day27.other;

public class Test44 {
    public static void main(String[] args) throws Exception {
        AA a = new BB();
        a.process();
        // 在重写方法时  如果父类方法抛出了异常  那么子类方法也要抛出异常
    }
}

class AA {
    void process() throws Exception {
        System.out.println("A");
        throw new Exception();
    }
}

class BB extends AA {
    void process() throws Exception {
        System.out.println("B");
    }
}